<template>
	<view class="radioBgc">
		<block v-for="(item, index) in list">
			<view class="radioListBox" v-if="list.length > 0">
				<view class="radioBox me-fx-row-start-c">
					<image :src="item.user.avatar" mode=""></image>
					<view class="radioRightBox">
						<view class="radioRightHead me-fx-row-sb-c" @click="zhaopianBtn(item)">
							<view class="">
								{{item.content}}
							</view>
							<image src="../../static/img/newimg/arrow.png" mode="" class="jiantouPic"></image>
						</view>
						<view class="me-fx-row-start-c">
							<view class="time">
								{{item.created_at}} 申请
							</view>
						</view>
					</view>
				</view>
				<view class="border ispass" v-if="item.log.status == '1'">
					已通过请求
				</view>
				<view class="border ispass" v-if="item.log.status == '2'">
					已拒绝请求
				</view>
				<block v-if="item.mode == '2'">
					<view class="isPassBox border  me-fx-row-sb-c" v-if="item.log.status == '0'">
						<view class="refuse" @click="jujueBtn(item.id)">
							拒绝
						</view>
						<view class="consent" @click="tongyiBtn(item.id)">
							同意
						</view>
					</view>
				</block>
			</view>
		</block>
		<view class="nohaveData" v-if="nohaveData">
			<image src="../../static/img/newimg/xx.png" mode=""></image>
			暂时没有更多数据啦~
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isPass: true,
				page: 1,
				list: [],
				last_page: 1,
				nohaveData: false,
				isZhankai: false
			}
		},
		onShow() {
			this.getIndex(this.page)
		},
		methods: {
			zhaopianBtn(){
				
			},
			getIndex(page) {
				this.$u.get('/message/album/validate/list/' + page).then(res => {
						if (res) {
							if (res.data.list.data.length > 0) {
								this.nohaveData = false
								if (res.data.list.last_page == 1) {
									this.list = res.data.list.data;
								} else {
									this.list = this.list.concat(res.data.list.data)
								}
							} else {
								this.nohaveData = true
							}
						}
					})
					.catch((res) => {})
			},
			onReachBottom() { //uniapp 监听下拉加载生命周期
				if (this.page >= this.last_page) {
					uni.showToast({
						title: '没有更多数据了',
						duration: 1000,
						icon: 'none'
					})
					return
				}
				this.page++
				this.getIndex(this.page)
			},
			jujueBtn(id) {
				let data = {
					status: 2,
					id: id
				}
				this.applay(data)
			},
			tongyiBtn(id) {
				let data = {
					status: 1,
					id: id
				}
				this.applay(data)
			},
			applay(data) {
				this.$u.put('/user/album/validate/deal', data).then(res => {
						if (res) {
							uni.showToast({
								title: res,
								duration: 1000,
								icon: 'none'
							})
						}
					})
					.catch((res) => {})
			},
		}
	}
</script>

<style>
	.jiantouPic {
		width: 15rpx !important;
		height: 27rpx !important;
		display: block;
	}

	.radioBgc {
		border-top: 1rpx solid rgba(245, 245, 245, 1);
		padding: 0 20rpx;
		margin-top: 20rpx;
	}

	.radioBox {
		padding: 26rpx;
		box-sizing: border-box;
		border-bottom: 1rpx solid rgba(245, 245, 245, 1);
	}

	.radioBox image {
		width: 104rpx;
		height: 104rpx;
		border-radius: 8rpx;
	}

	.radioRightBox {
		margin-left: 24rpx;
		width: 80%;
	}

	.lookPic {
		color: #666666;
		font-size: 30rpx;
	}

	.time {
		font-size: 26rpx;
		color: rgba(210, 99, 26, 1);
		margin-right: 12rpx;
	}

	.radioRightBox .rightjt {
		width: 10px;
		height: 20px;
	}

	.radioRightHead {
		font-size: 32rpx;
		color: rgba(68, 68, 68, 1);
		margin-bottom: 14rpx;
	}

	.radioListBox {
		background: rgba(255, 255, 255, 1);
		box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(235, 239, 242, 1);
		border-radius: 8rpx;
		margin-top: 14rpx;
	}

	.border {
		border-top: 1rpx solid #F5F5F5;
	}

	.ispass {
		color: #999999;
		font-size: 28rpx;
		color: rgba(153, 153, 153, 1);
	}

	.isPassBox {
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
	}

	.isPassBox view {
		width: 50%;
	}

	.ispass {
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
	}

	.refuse {
		font-size: 28rpx;
		color: rgba(153, 153, 153, 1);
	}

	.consent {
		height: 81rpx;
		background: rgba(138, 72, 245, 1);
		border-radius: 0 8rpx 0 0;
		font-size: 28rpx;
		color: rgba(255, 255, 255, 1);
	}

	.nickName {
		width: 200rpx;
		font-size: 30rpx;
		font-weight: bold;
		color: rgba(34, 34, 34, 1);
	}

	.nohaveData image {
		width: 100%;
		height: 537rpx;
		display: block;
	}

	.nohaveData {
		text-align: center;
		padding: 16rpx 30rpx;

	}
</style>
